#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main()
{
	int i,j;
	int x=10,y=5;
	int n=0;
	char input;
	
	int ny=4;
	
	int isfired=0;
	int iskilled=0;
	
	while(1)
	{	
		
		system("cls");
		printf("分数：%d\n",n);
		if (iskilled==0)
		{
			for (i=0;i<ny;i++)
				printf(" ");
			printf("+\n");
		}
		else printf("\n");
		
		if (isfired==0)
		{
			for (i=0;i<x;i++)
				printf("\n");
			iskilled=0;
		}
		else
		{
			for (i=0;i<x;i++)
			{
				for(j=0;j<y;j++)
					printf(" ");
				printf("  |\n");
			}
			if (y+2==ny)
			{
				iskilled=1;
				n++;
				ny+=2;
				if(ny==40)
				ny=4;
			}
			isfired=0;
		}
	
		for(j=0;j<y;j++)
			printf(" ")	;	
		printf("  *\n");
		for(j=0;j<y;j++)
			printf(" ")	;
		printf("*****\n");
		for(j=0;j<y;j++)
			printf(" ")	;
		printf(" * *\n");
		
		input=getch();
		if (input=='s')
			x++;
		if (input=='w')
			x--;	
		if (input=='a')
			y--;
		if (input=='d')
			y++;
		if (input==' ')	
			isfired=1;
			
	}      
	
	return 0;
}